﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ByrForumAPI;
using ByrForumAPI.MetaData;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ByrForumAPITest
{
    class Program
    {
        static void Main(string[] args)
        {

            string json = "{\"id\":\"1\", \"name\":\"Tom\"}";

            string content = System.IO.File.ReadAllText(@"C:\Users\xinxingy\Desktop\flash.json");

            Board board = JsonConvert.DeserializeObject<Board>(content);

            JObject o = JObject.Parse(content);
            Pagination page = JsonConvert.DeserializeObject<Pagination>(o["pagination"].ToString());
            List<Article> articles = JsonConvert.DeserializeObject<List<Article>>(o["article"].ToString());

            //Console.WriteLine(JsonConvert.SerializeObject(articles));
            System.IO.File.WriteAllText("out.txt", JsonConvert.SerializeObject(articles));
            //Console.WriteLine(user.ID);

            Console.WriteLine(JsonConvert.SerializeObject(json));
        }
    }
}
